#include<iostream>

using namespace std;
#include<list>
void printlist(list<int>&l) {
	for (list<int>::iterator it = l.begin(); it != l.end(); it++) {

		cout << *it << " ";
		
	}

	cout << endl;
}
 void test01() {
	 list<int>l1;
	 l1.push_back(10);
	 l1.push_back(20);
	 l1.push_back(30);
	 l1.push_back(40);
	 l1.push_back(50);
	 printlist(l1);
	 list<int>l2(l1.begin(), l1.end());
	 printlist(l2);

	 list<int>l3(l2);
	 printlist(l3);
	 list<int>l4(5,10);
	 printlist(l4);
	 list<int>l5;
	 l5 = l1;
	 list<int>l6;
	 l6.assign(l1.begin(), l1.end());
	 list<int>l7;
	 l7.assign(5, 10);
	 printlist(l5); printlist(l6); printlist(l7);

	 l6.swap(l7);
	 printlist(l6); printlist(l7);

	 if (l1.empty()) {
		 cout << "kong" << endl;
	 }
	 else {
		 list<int>l1;
	 }

	 l1.resize(8);
	 cout << "kong" << endl;
	 printlist(l1);
	 list<int>::iterator it = l1.begin();
	 it++;
	 cout << *it<< endl;
	 l1.reverse();
	 printlist(l1);
	 l1.sort();
	 printlist(l1);
	 
}

int main() {
	test01();


	system("pause");
	return 0;
}